package com.study.ssm.annotation02.config;

import com.study.ssm.annotation02.injection.UserDAO;
import com.study.ssm.annotation02.injection.UserService;
import com.study.ssm.annotation02.injection.UserServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import javax.annotation.Resource;

/**
 * @author zhoujunlin
 * @date 2023年07月27日 10:13
 * @desc
 */
@Configuration
@Import(AppConfig2.class)
public class AppConfig1 {

    @Resource
    private UserDAO userDAO;

    @Bean
    public UserService userService() {
        UserServiceImpl userService = new UserServiceImpl();
        userService.setUserDAO(userDAO);
        return userService;

    }
}
